package com.pactera.integral.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.pactera.integral.common.repository.GenericRepository;
import com.pactera.integral.entity.PerformanceScore;

@Repository("performanceScoreDao")
public interface PerformanceScoreDao  extends GenericRepository<PerformanceScore, String>{

	 PerformanceScore findByCode(String code);
	
	 @Transactional
	 @Modifying
	 @Query(value = "delete from int_performance_score where performance_score_id =:performanceScoreId ", nativeQuery = true)
	 Integer deleteAdditionalScore(@Param("performanceScoreId")String performanceScoreId);

	 PerformanceScore findByIdAndCode(String id, String code);
	 
	 PerformanceScore findById(String id);
	 
	 List<PerformanceScore> findByCategory(String category);
}
